﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WiTeach.ClassManagement.DAL;
using WiTeach.ClassManagement.Model;
using WiTeach.CourseManagement.View;

namespace WiTeach.ClassManagement.View
{
    /// <summary>
    /// TeachingPhoto.xaml 的交互逻辑
    /// </summary>
    public partial class TeachingPhoto : Page
    {
        public int lessonID;
        public int classHourID;
        public TeachingPhoto(int lessonID, int classHourID)
        {
            InitializeComponent();
            // 修改页面背景主题
            ImageBrush brush = new ImageBrush();
            brush.Stretch = Stretch.Fill;
            brush.ImageSource = new BitmapImage(new Uri(App.backgroundImage, UriKind.RelativeOrAbsolute));
            this.Background = brush;
            this.lessonID = lessonID;
            this.classHourID = classHourID;
            List<ClassHour> classhourList =  ClassHourDAL.getClassListByID(lessonID, classHourID);
            this.teachingPhoto.DataContext = classhourList;
        }
        private void backHome(object sender, RoutedEventArgs e)
        {
            CourseIndex courseIndex = new CourseIndex();
            this.NavigationService.Navigate(courseIndex);
        }

        private void backPreLevel(object sender, RoutedEventArgs e)
        {
            this.NavigationService.GoBack();
        }

        //private void ProgramWriting(object sender, RoutedEventArgs e)
        //{
        //    // 跳转至程序编写页面
        //    ProgramWriting programWritingPage = new ProgramWriting();
        //    this.NavigationService.Navigate(programWritingPage);
        //}

        //private void ProgramRecording(object sender, RoutedEventArgs e)
        //{
        //    ProgramRecording programRecording = new ProgramRecording();
        //    this.NavigationService.Navigate(programRecording);
        //}

        //private void TeachingVideo(object sender, RoutedEventArgs e)
        //{
        //    TeachingVideo teachingVideo = new TeachingVideo();
        //    this.NavigationService.Navigate(teachingVideo);
        //}


        private void program_teachingPhoto_backmain_mouse_enter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 69;
            image.Width = 105;
        }
        private void program_teachingPhoto_backmain_mouse_leave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 60;
            image.Width = 98;
        }
        private void program_teachingPhoto_back_mouse_enter(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 69;
            image.Width = 105;
        }
        private void program_teachingPhoto_back_mouse_leave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            Image image = sender as Image;
            image.Height = 60;
            image.Width = 98;
        }

        //private void program_teachingPhoto_writing_enter(object sender, System.Windows.Input.MouseEventArgs e)
        //{
        //    Image image = sender as Image;
        //    image.Height = 96;
        //    image.Width = 100;
        //}
        //private void program_teachingPhoto_writing_leave(object sender, System.Windows.Input.MouseEventArgs e)
        //{
        //    Image image = sender as Image;
        //    image.Height = 94;
        //    image.Width = 90;
        //}

        //private void program_teachingPhoto_recording_enter(object sender, System.Windows.Input.MouseEventArgs e)
        //{
        //    Image image = sender as Image;
        //    image.Height = 96;
        //    image.Width = 100;
        //}
        //private void program_teachingPhoto_recording_leave(object sender, System.Windows.Input.MouseEventArgs e)
        //{
        //    Image image = sender as Image;
        //    image.Height = 94;
        //    image.Width = 90;
        //}

        //private void program_teachingPhoto_video_enter(object sender, System.Windows.Input.MouseEventArgs e)
        //{
        //    Image image = sender as Image;
        //    image.Height = 96;
        //    image.Width = 100;
        //}
        //private void program_teachingPhoto_video_leave(object sender, System.Windows.Input.MouseEventArgs e)
        //{
        //    Image image = sender as Image;
        //    image.Height = 94;
        //    image.Width = 90;
        //}
    }
}
